﻿@{
    ViewBag.Title = "DeviceRepairDetailForm";
    Layout = "~/Views/Shared/_Form.cshtml";
}

<script>
    var keyValue = request('keyValue');
    $(function () {
        //获取表单
        if (!!keyValue) {
            var rowdata = top.Form.$("#gridTable1").jqGridRow()[0];
            if (rowdata.State != "待处理") {
                $("inupt").attr("disabled", "disabled");
            }
            $("#form1").SetWebControls(rowdata);
        }
    });

    //保存表单
    function AcceptClick() {
        if (!$('#form1').Validform()) {
            return false;
        }
        var $gridTable = top.Form.$("#gridTable");
        var postData = $("#form1").GetWebControls("");
        if (!!keyValue) {
            $gridTable.setRowData(keyValue, postData);
        } else {
            $gridTable.addRowData(($gridTable.jqGrid("getRowData").length + 1), postData);
        }
        dialogMsg("操作成功。", 1);
        dialogClose();
    }

</script>

<div id="RoomDetailAdd">
    <table class="form">
        <tr>
            <th class="formTitle">设备</th>
            <td class="formValue">
                <input id="DeviceName" readonly type="text" class="form-control" />
            </td>
        </tr>
        <tr>
            <th class="formTitle">问题描述<font face="宋体">*</font></th>
            <td class="formValue"><input id="Issuse" type="text" class="form-control" /></td>
        </tr>
        <tr>
            <th class="formTitle">维修人</th>
            <td class="formValue">
                <input id="WXR" type="text" class="form-control completetr baseclass" />
                <span class="input-group-btn">
                    <a onclick="GetMan(3)" class="form-control completetr BaseClass" style="cursor: pointer"><i class="fa fa fa-book completetr " style=" font-size: 20px; padding-right: 5px;   color: gray"></i></a>
                </span>
            </td>
        </tr>
        <tr>
            <th class="formTitle">维修开始时间</th>
            <td class="formValue">
                <input id="WXBeginTime" type="text" class="form-control input-wdatepicker" onfocus="WdatePicker({ dateFmt: 'yyyy-MM-dd', maxDate: '#F{$dp.$D(\'WXEndTime\')}' })" value="@DateTime.Now.ToString("yyyy-MM-dd")" />
            </td>
        </tr>
        <tr>
            <th class="formTitle">维修结束时间</th>
            <td class="formValue">
                <input id="WXEndTime" type="text" class="form-control input-wdatepicker" onfocus="WdatePicker({ dateFmt: 'yyyy-MM-dd', minDate: '#F{$dp.$D(\'WXBeginTime\')}' })" value="@DateTime.Now.AddDays(1).ToString("yyyy-MM-dd")" />
            </td>
        </tr>
        <tr>
            <th class="formTitle">维修时长</th>
            <td class="formValue">
                <input id="WXDate" type="text" readonly class="form-control" />
            </td>
        </tr>
    </table>
</div>